const collection = (state = [], action) => {
    if (action.type == 'GET_COLLECT_DATA') {
        return action.data
    } else if (action.type === 'ADD_COLLECT_DATA') {
        return [...state, action.value]
    } else if (action.type == 'DEL_COLLECT_DATA') {
        console.log('in del')
        let arr;
        arr = [...state].filter((item) => {
            return item.id != action.index
        })
        return arr
    } else return state;
}
export default collection;